﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Micronet.OpenWeb.Com.BLL;
using Micronet.OpenWeb.Entity;
using Micronet.OpenWeb.Utils;

namespace Micronet.OpenWeb.OpenWeb.Admin.Views.Shared.OpenCommunity
{
    public partial class OpenCommunityProfileDetailsEdit : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
          
          // OwOpenCommunityProfileDetailsEntity o = new OwOpenCommunityProfileDetailsEntity();
         //   o.Description
       //    OwOpenCommunityProfileDetailsBLL.OwUpdate()


            if ("ID".OwQsIsExist())
            {

                OpenCommunityProfileDetailsDv.DefaultMode = DetailsViewMode.Edit;

            }
            else
            {
                OpenCommunityProfileDetailsDv.DefaultMode = DetailsViewMode.Insert;
                
            }

            CommunityProfileDetailsOds.Inserted += new ObjectDataSourceStatusEventHandler(OpenCommunityProfileDetailsOds_Inserted);
            CommunityProfileDetailsOds.Deleted += new ObjectDataSourceStatusEventHandler(OpenCommunityProfileDetailsOds_Deleted);
            CommunityProfileDetailsOds.Updated += new ObjectDataSourceStatusEventHandler(OpenCommunityProfileDetailsOds_Updated);
        }

        void OpenCommunityProfileDetailsOds_Updated(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("OpenCommunityProfileDetailsAdmin.aspx");
        }

        void OpenCommunityProfileDetailsOds_Deleted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("OpenCommunityProfileDetailsAdmin.aspx");

        }

        void OpenCommunityProfileDetailsOds_Inserted(object sender, ObjectDataSourceStatusEventArgs e)
        {
            Response.Redirect("OpenCommunityProfileDetailsAdmin.aspx");

        }
    }
}